import BuffBase from "../Manager/BuffBase";



//移动速度降低
export default class MoveSlowDown extends BuffBase {

    RemoveTime = 0;
    RemoveMaxTime = 2;
    DownSpeed = 0.5;
    MeshObj: Laya.Sprite3D;
    InitBuffBase() {
        //super.InitBuffBase();
    }

    BuffOccur() {

    }
    RefreshBuff() {
        this.RemoveTime = 0;
    }
    //Buff每帧调用
    BuffOnTick() {
        this.RemoveTime += (Laya.timer.delta / 1000);
        if (this.RemoveTime >= this.RemoveMaxTime) {
            this.BuffRemoved();
            return;
        }
        // console.log(this.m_SoldiersBase.m_TempAttributeBase.m_Speed);
        //this.m_SoldiersBase.m_TempAttributeBase.m_Speed = (this.m_SoldiersBase.m_TempAttributeBase.m_Speed - (4 * this.m_Target.m_TempAttributeBase.m_SoldierLv)) * (1 - 0.3);
        //console.log(this.m_SoldiersBase.m_TempAttributeBase.m_Speed);
    }
    //Buff移除
    BuffRemoved() {
        if (this.MeshObj != null) {
            this.MeshObj.removeSelf();
            this.MeshObj.destroy();
        }
        this.MeshObj = null;
        super.BuffRemoved();
    }
    //受到伤害
    BuffBeHurt() {

    }
    //攻击时
    BuffOnHit() {

    }
    //被杀死时
    BuffBeforeKilled() {
        this.BuffRemoved();
    }
    //敌人死亡时
    BuffAfterKilled() {

    }

}